Conversation
|
Looks neat. I'm however curious as to how other errors (such as validation, not found) and even success responses would be handled. Or is there some benefit in having a single response helper where all the responses are consolidated? |
Yeah I second this. I thought we were going to have |
|
Nice on @moyo-paystack. We've not caught unhandled exceptions in this PR though. The way i've seen it done in express is pretty straightforward. e.g. |
|
@ife-paystack and @opeyemi-paystack I have made changes to the PR based on the discussion here. Please take another look |
Nice @moyo-paystack! What do you think about having a response handler that houses the various response functions? I'm not sure we need each function in a separate file cc @ife-paystack |
Yes, this was exactly my thought too, this method you've implemented would mean we have a response file for each error code? |
|
@ife-paystack and @opeyemi-paystack I have made changes to the PR based on the discussion here. Please take another look
I could make each response to be in one file. I separated the 4xx and 5xx into separate response methods cos I think it's easier to follow. |
I've moved all the responses to one file |
|
Tests 👀 @moyo-paystack |
👀 |
Lol @ife-paystack sorry for the non-reply. Will get on to the tests later this evening. |
|
@moyo-paystack please help resolve conflicts on this and push again |
Changes